<include file="public/layout" />
<style>
    dd.opt table{
        width: 100%;
    }
    dd.opt tr{
        border: 1px solid #f4f4f4;
        padding: 8px;
    }
    dd.opt tr td{
        border: 1px solid #f4f4f4;
    }
    .ys-btn-close {
        position: relative;
        top: -12px;
        left: -16px;
        width: 18px;
        height: 18px;
        border: 1px solid #ccc;
        line-height: 18px;
        text-align: center;
        display: inline-block;
        border-radius: 50%;
        z-index: 1;
        background-color: #fff;
        cursor: pointer;
    }
    .selected-group-goods {
        background-color: #FFF;
        width: 162px;
        padding: 9px;
        margin-bottom: 10px;
        border: solid 1px #E6E6E6;
        box-shadow: 2px 2px 0 rgba(153,153,153,0.1);
    }
	.title{
		font-weight: bold;
		font-size: 13px;
	}
</style>
<script src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>
<style type="text/css">
    html, body {
        overflow: visible;
    }
</style>

<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>用户模板详情</h3>
            </div>
        </div>
    </div>
    <br>
    <div class="title">
		定制订单信息
	</div>
	<form class="form-horizontal" id="handleposition" method="post">
        <input type="hidden" name="tuid" value="{$info.tuid}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>标题</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="title" id="title" value="{$info.title}" disabled="disabled" class="input-txt">
                </dd>
            </dl>
            
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>emaill</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="emaill" id="emaill" value="{$info.emaill}" class="input-txt">
                </dd>
            </dl>
            
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>phone</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="phone" id="phone" value="{$info.phone}" class="input-txt">
                </dd>
            </dl>
            
            <dl class="row">
                <dt class="tit">
                    <label><em>*</em>状态</label>
                </dt>
                <dd class="opt">
                    <input name="state" id="state" value="{$info.state}" type="hidden" disabled="disabled" class="input-txt">
                    <input type="text" value="{$cstate[$info.state]}" disabled="disabled" class="input-txt">
                    
                    
                </dd>
            </dl>
			
			<if condition="$info.state eq 1">
				<div class="bot">
					<a id="submit1" onclick="verifyForm(2,this)" data-url="{:U('Admin/Custom/editusercustom')}" class="ncap-btn-big ncap-btn-green">确认</a>
				</div>
            <elseif condition="$info.state eq 2"/>
                <div class="bot">
                	<a id="submit2" onclick="verifyForm(3,this)" data-url="{:U('Admin/Custom/editusercustom')}" class="ncap-btn-big ncap-btn-green">撤销</a>
                </div>
            <else/>
            </if>
			
            
        </div>
    </form>
    
    <div class="title">
		定制订单属性
	</div>
	
    <div class="flexigrid">

        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr style="background-color: #52c0e5;">
                        <th class="sign" axis="col0">
                            <div style="width: 24px;"><i class="ico-check"></i></div>
                        </th>
                        <th align="left" abbr="article_title" axis="col3" class="">
                            <div style="text-align: left; width: 100px;" class="">id</div>
                        </th>
                        <th align="left" abbr="article_title" axis="col3" class="">
                            <div style="text-align: left; width: 300px;" class="">属性</div>
                        </th>
                        <th align="left" abbr="article_time" axis="col6" class="">
                            <div style="text-align: left; width: 300px;" class="">属性值</div>
                        </th>
                        <th align="center" abbr="article_time" axis="col6" class="">
                            <div style="text-align: center; width: 120px;" class="">类型</div>
                        </th>
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="tDiv">
            <div style="clear:both"></div>
        </div>
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table>
                    <tbody>
                    <volist name="lists" id="list">
                    	<if condition="$list['tp'] eq 2">
                        	<tr>
	                            <td class="sign">
	                                <div style="width: 24px;"><i class="ico-check"></i></div>
	                            </td>
	                            <td align="left" class="">
	                                <div style="text-align: left; width: 100px;">{$list.id}</div>
	                            </td>
	                            <td align="left" class="">
	                                <div style="text-align: left; width: 300px;">{$list.attname}</div>
	                            </td>
	                            <td align="left" style="height: 70px;">
	                                <div style="text-align: left;height: 70px; width: 300px;">
	                                	<!--<i id="attvalue" class="fa fa-picture-o" onmouseover="layer.tips('<img src={$list.attvalue}>',this,{tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>-->
	                                	<!--<img id="img_i" src='__ROOT__/{$list.attvalue}' style="width: 65px;height:auto;" 
	                                		onmouseover="layer.tips('<img src=__ROOT__/{$list.attvalue}>',this,{tips: [1, '#fff'],time:5000});" onmouseout="layer.closeAll();"></img>-->
	                                		
	                                	<volist name="list['imgarr']" id="vo">
	                                		<img id="img_i" src='__ROOT__/{$vo}' style="width: 65px;height:auto;" 
	                                		onmouseover="layer.tips('<img src=__ROOT__/{$vo}>',this,{tips: [1, '#fff'],time:5000});" onmouseout="layer.closeAll();"></img>                       
	                                	</volist>
	                                </div>
	                            </td>
	                            <td>
	                                <div style="text-align: center; width: 120px;">图片</div>
	                            </td>
	                            <td align="" class="" style="width: 100%;">
	                                <div>&nbsp;</div>
	                            </td>
                        	</tr>
                        <else/>
                        	<tr>
	                            <td class="sign">
	                                <div style="width: 24px;"><i class="ico-check"></i></div>
	                            </td>
	                            <td align="left" class="">
	                                <div style="text-align: left; width: 100px;">{$list.id}</div>
	                            </td>
	                            <td align="left" class="">
	                                <div style="text-align: left; width: 300px;">{$list.attname}</div>
	                            </td>
	                            <td align="left" class="">
	                                <div style="text-align: left; width: 300px;">{$list.attvalue}</div>
	                            </td>
	                            <td>
	                            	<div style="text-align: center; width: 120px;">文本</div>	                         
	                            </td>
	                            <td align="" class="" style="width: 100%;">
	                                <div>&nbsp;</div>
	                            </td>
                        	</tr>
                        </if>
                    </volist>
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
	</div>
	
	
</div>
    
</div>
<script type="text/javascript">
    
    function verifyForm(state,obj){
        $('span.err').hide();
        
        var todata = $('#handleposition').serialize();
        todata+="&state="+state;
//      console.log(todata);
        $.ajax({
            type: "POST",
            url: $(obj).attr('data-url'),
            data: todata,
            async:false,
            dataType: "json",
            error: function () {
                layer.alert("服务器繁忙, 请联系管理员!");
            },
            success: function (data) {
                if (data.status == 1) {
                    layer.msg(data.msg, {
                        icon: 1,
                        time: 1500
                    }, function(){
                        location.href = "{:U('Admin/Custom/userindex')}";
                    });
                } else {
                	var result = data.result;
                	var errormsg = '';
                	for(var key in result){
                		errormsg += result[key];
                	}
                	
                    layer.msg(data.msg+":"+errormsg, {icon: 2,time: 3000});
//                  $.each(data.result, function (index, item) {
//                      $('#err_' + index).text(item).show();
//                  });
                }
            }
        });
    }

    function img_call_back(fileurl_tmp) {
        $("#prom_img").val(fileurl_tmp);
        $("#img_a").attr('href', fileurl_tmp);
        $("#img_i").attr('onmouseover', "layer.tips('<img src="+fileurl_tmp+">',this,{tips: [1, '#fff']});");
    }

    $(document).ready(function(){

    });
</script>
</body>
</html>